<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page import="org.springframework.context.*"%>
<%@ page import="org.springframework.web.context.support.*" %>
<%@ page import="cn.edu.seig.pojo.Scope" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Spring Bean的作用域</title>
</head>
<body>
<%
// 获取Web应用初始化的Spring容器
ApplicationContext ac2 =WebApplicationContextUtils.getWebApplicationContext(application);
// 两次获取容器中id为p的Bean
    Scope p1 = (Scope)ac2.getBean("p3");
    Scope p2 = (Scope)ac2.getBean("p3");
%>
<%=p1%><br/>
<%=p2%><br/>
<%=(p1==p2)%>
</body>
</html>